package com.gzx.plugin.data.wckj.mapper;

import com.gzx.plugin.data.wckj.entity.JudgeRepayInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WckjJudgeRepayInfoDao {
    @Insert("<script>" +
            "INSERT INTO data_wckj_hhxx " +
            "(ywyh_id, loan_no, period, repay_status, repay_date, " +
            "repay_amount, derate_amount, repay_principal, repay_interest, " +
            "repay_service_fee, repay_other_fee, repay_guarantee_fee, " +
            "repay_overdue_service_fee, repay_overdue_penalty, create_time, update_time) " +
            "VALUES " +
            "<foreach collection='judgeRepayInfoList' item='wckjHhxx' separator=','>" +
            "(" +
            "#{wckjHhxx.ywyhId}, " +
            "#{wckjHhxx.loanNo}, " +
            "#{wckjHhxx.period}, " +
            "#{wckjHhxx.repayStatus}, " +
            "#{wckjHhxx.repayDate}, " +
            "#{wckjHhxx.repayAmount}, " +
            "#{wckjHhxx.derateAmount}, " +
            "#{wckjHhxx.repayPrincipal}, " +
            "#{wckjHhxx.repayInterest}, " +
            "#{wckjHhxx.repayServiceFee}, " +
            "#{wckjHhxx.repayOtherFee}, " +
            "#{wckjHhxx.repayGuaranteeFee}, " +
            "#{wckjHhxx.repayOverdueServiceFee}, " +
            "#{wckjHhxx.repayOverduePenalty}, " +
            "now(), " +   // 数据库生成时间
            "now()" +
            ")" +
            "</foreach>" +
            "</script>")
    void batchSave(@Param("judgeRepayInfoList") List<JudgeRepayInfo> judgeRepayInfoList);
}
